<template>
  <div>
     <div id="test">{{message}}</div>
     <ul>
      <li v-for="test in list">{{test}}</li>
     </ul>
      <Button type="primary" v-on:click='testGET'>测试</Button>
  </div>

</template>
<script>
import axios from 'axios'
import qs from 'qs'
export default {
  data () {
    return {
      message: 'Hello Vue!',
      list: [1, 2, 3]
    }
  },
  computed: {
  },
  methods: {
    testGET () {
      let data = { 'a': 1 }
      axios.post(`/api`, qs.stringify(data))
        .then(res => {
          console.log('res=>', res.data)
          this.list = res.data
        })
    }
  }
}

</script>

<style>
</style>
